﻿using System;
using ARS.Control.Attributes;

namespace ARS.Control.Custom.DataPaging.Attributes
{
    /// <summary>
    /// basicmessage_ruleralation:实体类(属性说明自动提取数据库字段的描述信息)
    /// </summary>
    [Serializable]
    public class DbOperat
    {
        //删除执行的条件
        /// <summary>
        /// 删除执行的语句.{0}=TableName,{1}=KeyField,{2}=id
        /// </summary>
        public string DeleteSql
        {
            get;
            set;
        }

        

        //public DbOperat()
        //{
        //    DeleteSql = "";
        //}

        /// <summary>
        /// 附加信息，可以保存权限编码等
        /// </summary>
        //public string Tag
        //{
        //    get;
        //    set;
        //}


        #region 操作
        
        private string _OperatSqlList;
        /// <summary>
        /// 操作语句字符串
        /// </summary>
        public string OperatSqlList
        {
            get
            {

                return ListAndItem.GetValueList(_OperatSqlListItem, ref _OperatSqlList);
            }
            set
            {
                _OperatSqlList = value;
            }
        }

        private string[] _OperatSqlListItem;
        /// <summary>
        /// 操作语句的项
        /// </summary>
        public string[] OperatSqlListItem
        {
            get
            {
                return ListAndItem.GetValueListItem(_OperatSqlListItem, ref _OperatSqlList);
            }
            set
            {
                _OperatSqlListItem = value;
            }
        }
        #endregion

        #region 排序

        private string _OrderList;

        public string OrderList
        {
            get
            {
                return ListAndItem.GetValueList(_OrderListItem, ref _OrderList);
            }
            set
            {
                _OrderList = value;
            }
        }


        private string[] _OrderListItem;
        public string[] OrderListItem
        {
            get
            {
                return ListAndItem.GetValueListItem(_OrderListItem, ref _OrderList);
            }
            set
            {
                _OrderListItem = value;
            }
        }

        #endregion

        #region 查询

        /// <summary>
        /// 查询的where
        /// </summary>
        private string _SearchList;
        public string SearchList
        {
            get
            {
                return ListAndItem.GetValueList(_SearchListItem, ref _SearchList);
            }
            set
            {
                _SearchList = value;
            }
        }

        private string[] _SearchListItem;
        public string[] SearchListItem
        {
            get
            {
                return ListAndItem.GetValueListItem(_SearchListItem, ref _SearchList);
            }
            set
            {
                _SearchListItem = value;
            }
        }




        #endregion
    }
}
